#ifndef SLIDEGENERATOR_H
#define SLIDEGENERATOR_H
#include "slidemodel.h"
#include "sqlitedbwrapper.h"
#include "embeddedsvgviewer.h"
#include <QFile>

class SlideGenerator : public QObject
{
    //A Controller class that provides an API for whatever module accepts
    //cues/messages (probably a UDP/Lua Interface)
    //---
    //The class coordinates the interactions between all the other modules,
    //and any assets that are required to generate the slides
    Q_OBJECT
public:
    SlideGenerator(SqliteDbWrapper& db);
    SlideGenerator(SqliteDbWrapper& db, QFile& device);
    ~SlideGenerator();


public slots: //N.B. Slots are a Qt mechanism that is used for debugging,
              //Removing this feature will not break the module

    //Interface
    void LoadNewTemplate(const char* inputTemplatePath);
    void FetchNewRoute(const char* routeNumber);
    void SelectFocalStop(StopItr& focalStopIterator);
    void SelectFocalStop(std::string focalStopName);
    void SelectFocalStop(int focalStopPosition);
    void GenerateSlide();


private:
    SqliteDbWrapper* m_dataBase;
    std::string m_routeId;
    QFile* m_outputDevice;
    SlideModel m_slideModel;
    StopItr m_focalStop;
    EmbeddedSvgViewer* m_viewer;


    void exportSlideModel(void);
    void generateDynamicContent(void);
};

#endif // SLIDEGENERATOR_H
